package com.nut.spp.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nut.spp.util.JacksonUtils;
import lombok.Data;

/**
 * 退款记录
 */
@Data
@TableName("biz_refund_record")
public class RefundRecord {

    @JsonIgnore
    private Integer id;

    @JsonAlias("app_id")
    private String appId;

    private Long orderId;

    @JsonAlias("id")
    private String refundId;

    @JsonAlias("payment_id")
    private String paymentId;

    @JsonAlias("refund_amt")
    private String refundAmt;

    private String json;


    public static void main(String[] args) {

        String ddd = "{\"payment_order_no\":\"1689404905670876\",\"created_time\":\"1689591288000\",\"reason\":\"\",\"refund_amt\":\"0.01\",\"notify_url\":\"\",\"payment_id\":\"002212023071515082510526186466796187648\",\"prod_mode\":\"true\",\"channel_no\":\"2023071721R3revt\",\"succeed_time\":\"1689591288000\",\"id\":\"0022120230717185447980526968208421167104\",\"app_id\":\"app_4a6f810d-482b-498b-be39-27a0b4cda0a5\",\"refund_order_no\":\"1689591268760992\",\"fee_amt\":\"0.00\",\"object\":\"refund\",\"status\":\"pending\"}";

        RefundRecord payRecord = JacksonUtils.toObj(ddd, RefundRecord.class);

        System.out.println(payRecord.getAppId());

    }
}
